package com.acquisition.service.impl;

import com.acquisition.entity.SysPermission;
import com.acquisition.mapper.SysPermissionMapper;
import com.acquisition.service.SysPermissionService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;

/**
 * @Author Jay Chou
 * @Description 权限表(SysPermission)表服务实现类
 * @Date 2023-04-12 12:31
 **/
@Service("sysPermissionService")
public class SysPermissionServiceImpl implements SysPermissionService {

    @Resource
    private SysPermissionMapper sysPermissionMapper;

    /**
     * @Author Jay Chou
     * @Description 通过id查询权限信息
     * @Date 2023-04-12 14:00
     * @param id
     * @return com.acquisition.entity.SysPermission
     **/
    @Override
    public SysPermission queryById(String id) {
        return sysPermissionMapper.queryById(id);
    }

    /**
     * @Author Jay Chou
     * @Description 按条件筛选分页查询权限列表
     * @Date 2023-04-12 14:03
     * @param sysPermission
     * @return java.util.List<com.acquisition.entity.SysPermission>
     **/
    @Override
    public List<SysPermission> queryPermissionList(SysPermission sysPermission) {
        return sysPermissionMapper.queryPermissionList(sysPermission);
    }

    /**
     * @Author Jay Chou
     * @Description 按用户id查询权限列表
     * @Date 2023-04-12 14:04
     * @param userId
     * @return java.util.List<com.acquisition.entity.SysPermission>
     **/
    @Override
    public List<SysPermission> queryPermissionListByUserId(String userId) {
        return sysPermissionMapper.queryPermissionListByUserId(userId);
    }

    /**
     * @Author Jay Chou
     * @Description 按接口路径查询权限列表
     * @Date 2023-04-12 14:04
     * @param path
     * @return java.util.List<com.acquisition.entity.SysPermission>
     **/
    @Override
    public List<SysPermission> queryPermissionListByPath(String path) {
        return sysPermissionMapper.queryPermissionListByPath(path);
    }

    /**
     * @Author Jay Chou
     * @Description 新增权限
     * @Date 2023-04-12 14:02
     * @param sysPermission
     * @return int
     **/
    @Override
    public int insert(SysPermission sysPermission) {
        return sysPermissionMapper.insert(sysPermission);
    }

    /**
     * @Author Jay Chou
     * @Description 修改权限
     * @Date 2023-04-12 14:02
     * @param sysPermission
     * @return int
     **/
    @Override
    public int update(SysPermission sysPermission) {
        return sysPermissionMapper.update(sysPermission);
    }

    /**
     * @Author Jay Chou
     * @Description 删除权限
     * @Date 2023-04-12 14:01
     * @param id
     * @return int
     **/
    @Override
    public int deleteById(String id) {
        return sysPermissionMapper.deleteById(id);
    }

}